include /data/redis/etc/redis_common.conf
port 7001
logfile "/data/redis/logs/redis_7001.log"
maxmemory {{ memory }}
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys-random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
maxmemory-policy allkeys-lru
appendfilename "appendonly_7001.aof"
dbfilename "dump_7001.rdb"
auto-aof-rewrite-percentage 80
# Generated by CONFIG REWRITE
daemonize yes
bind 0.0.0.0
tcp-keepalive 60
dir "/data/redis/data"

masterauth "{{ passwd }}"
requirepass "{{ passwd  }}"
appendonly yes
no-appendfsync-on-rewrite yes
protected-mode no

{% if host == "master" %}
 
{% endif %}
{% if host == 'slave' %}
slaveof {{ master_ip }} 7001
{% endif %}
